# Replication Package: Demographics, Financial Crises, and Sudden Stops

## Overview
This folder contains all files needed to replicate the analysis in "Demographics, Financial Crises, and Sudden Stops." The paper shows that demographics add approximately 60% incremental R-squared to early warning models. Youth dependency raises crisis risk while old-age dependency is protective (coefficient=-0.542***). Results are driven by non-OECD countries.

## Requirements
- Python 3.10+
- pandas, numpy, scipy, statsmodels
- Data files in data/processed/

## Structure
- `scripts/` — Analysis scripts (run in phase order)
- `src/` — Shared modules (PanelGLS estimator, data loading, country classifications)
- `data/processed/` — Processed panel data (crises_panel.csv, lv_episodes.csv)
- `output/tables/` — Generated output tables
- `paper/` — Paper manuscript and references

## Reproduction
Run scripts in numerical phase order:
```
python scripts/phase1_data_prep.py
python scripts/phase2_crisis_prediction.py
python scripts/phase3_sudden_stops.py
python scripts/phase4_severity_type.py
python scripts/phase5_openness_interaction.py
python scripts/phase6_duration.py
python scripts/phase7_robustness.py
```

## Data Sources
- UN World Population Prospects 2024
- IMF World Economic Outlook
- Penn World Table 10.01
- Chinn-Ito KAOPEN Index
- Lane & Milesi-Ferretti External Wealth of Nations
- Laeven & Valencia Banking Crisis Database

## Notes
- All analysis uses the 140-country expanded panel (EBA-49 + SSA-20 + EU expansion + Tier 1 expansion)
- The `src/` modules are from the multilateral/followup project and contain the expanded country lists
- Z x KAOPEN insignificant; middle-tercile openness most destabilizing
- Non-OECD drives results
